package com.suixinsanren.design.observer.demo01;

public class StatisticsDisplay implements Observer,Display {

    private Double temperature;
    private Double humidity;
    private Double pressure;

    @Override
    public void update(Double temperature, Double humidity, Double pressure) {
        this.temperature = temperature;
        this.humidity = humidity;
        this.pressure = pressure;
        this.display();
    }


    @Override
    public void display() {
        System.out.println("当前观测值：温度="+temperature+"湿度="+humidity+"压强="+pressure);
    }
}
